const requestError = '接口错误'
// 时间格式化
function formatDate (time) {
  let dateTime = new Date(time * 1000)
  let year = dateTime.getFullYear()
  let month = dateTime.getMonth() + 1
  month = month < 10 ? '0' + month : month
  let date = dateTime.getDate()
  date = date < 10 ? '0' + date : date
  let hour = dateTime.getHours()
  hour = hour < 10 ? '0' + hour : hour
  let minute = dateTime.getMinutes()
  minute = minute < 10 ? '0' + minute : minute
  let second = dateTime.getSeconds()
  second = second < 10 ? '0' + second : second
  return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second
}

// 日期格式化
function formatOnlyDate () {
  let dateTime = new Date()
  let year = dateTime.getFullYear()
  let month = dateTime.getMonth() + 1
  month = month < 10 ? '0' + month : month
  let date = dateTime.getDate()
  date = date < 10 ? '0' + date : date
  return year + "-" + month + "-" + date
} 